import pandas as pd
# 方法1: 字典dict 创建DataFrame
data = {
    'name': ['Alice', 'Jack', 'Tom'],
    'age': [10, 11, 12],
}

df = pd.DataFrame(data)
print(df)
""" 
    name  age
0  Alice   10
1   Jack   11
2    Tom   12
"""

# 方法2: 字典dict 创建DataFrame
data = [
    {"a":1, "b":2},
    {"a":3, "b":4, "c":5},
]
df = pd.DataFrame(data)
print(df)
""" 
   a  b    c
0  1  2  NaN
1  3  4  5.0
"""